package demo2;

/**
 * Description:
 * Date: 2025-10-15
 * Time: 20:30
 */
//鸭子可以实现海陆空同时进行活动
public class Duck extends Animal implements IFlying,IRunnig,ISwimming{
    public Duck(String name, int age) {
        super(name, age);
    }

    public void eat() {
        System.out.println(this.name + "正在吃鸭粮！");

    }

    @Override
    public void iFlying() {
        System.out.println(this.name + "正在飞");
    }

    @Override
    public void iRunnig() {
        System.out.println(this.name + "正在跑");
    }

    @Override
    public void iSwimming() {
        System.out.println(this.name + "正在游泳");
    }
}
